<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <%include file="include/edit_nav.html"%>
    <div class="div-info-body">
      <div class="right">
	<%if $session.oauth == 'pengyou'%>
	<a href="/users/add_photo_through_qq?userid=<%$user.id%>">添加照片</a>
	<%else%>
	<a href="/users/add_photo?userid=<%$user.id%>">添加照片</a>
	<%/if%>
      </div>

      <%if $authorized || $user.open eq 'public' %>
      <%if $album|@count gt 0%>
      <table>
        <caption>相册</caption>
          <tr>
              <th>编号</th>
              <th>预览</th>
              <th>照片描述</th>
              <th>状态</th>
              <th>操作</th>
          </tr>
	  <% foreach name=album from=$album item=photo %>	  
          <tr>
              <td><%$photo.id%></td>
              <td>
                <img class="photo_preview" src="<%$photo.photo%>"/>
	      </td>
              <td><%$photo.memo%></td>
              <td><%if $photo.state eq $RESOURCE_STATE_DELETED%>已删除<%else%>正常<%/if%></td>
              <td>
                <a href="/users/edit_photo?photoid=<%$photo.id%>">编辑</a>
                <a href="/users/delete_photo?photoid=<%$photo.id%>">删除</a>
                <a href="/users/photo_history?photoid=<%$photo.id%>">历史记录</a>
	      </td>
          </tr>
	  <%/foreach%>
      </table>
      <%else%>
      <span class="warnning">
	没有照片！
      </span>
      <%/if%>
      <%else%>
      <span class="warnning">
	没有权限查看！
      </span>
      <%/if%>
    </div>
    <div class="clear"></div>
  </div>
</div>
<%include file="include/bottom.html"%>
